<template>
	<view :class="currentTheme">
		<a-nabbar name="操作成功" />
		<view class="">
			<view class="top-success u-flex u-row-center">
				<view class="u-text-center">
					<u-icon v-if="option.flag==1" :name="option.flag==1 ? 'checkmark-circle-fill' : 'close-circle-fill'" color="#765CFE" size="80"></u-icon>
					<u-icon v-if="option.flag==2" :name="option.flag==2 ? 'checkmark-circle-fill' : 'close-circle-fill'" color="#765CFE" size="80"></u-icon>
					<view class="u-margin-top-28 text-color-765CFE u-font-36">{{option.title}}</view>
				</view>
			</view>
			<view class="address-btn">
				<view class="add-address text-color-765CFE u-font-26 btn-width bg-primary" @click="getOrder" v-if="option.flag==1">
					查看订单
				</view>
        <view class="add-address text-color-765CFE u-font-26 btn-width bg-primary" @click="getMoney" v-if="option.flag==2">
          查看钱包
        </view>
				<view class="add-address text-color-765CFE u-font-26 btn-width" @click="backIndex">
					返回首页
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				option:{
					title:"支付成功",
					flag:1
				}
			};
		},
		onLoad(option) {
			this.option = option
		},
		methods: {
			backIndex() {
				this.$u.route({
					type:'reLaunch',
					url:'/pages/index/index'
				})
			},
			getOrder(){
				this.$u.route({
					url:'/pagesA/order/order',
					params:{
						name:'待发货',
						label:{script:'买本订单',ticket:'票务订单','groupBuy':'买本订单'}[this.option.type],
						type:this.option.type,
						orderStatus:2
					}
				})
			},
      getMoney(){
        this.$u.route({
          url:'/pagesB/wallet/wallet'
        })
      },
		},
	}
</script>

<style lang="scss" scoped>
.btn-width{
	width: 300rpx;
	margin: 38rpx auto;
}
.bg-primary{
	background-color: $primary;
	color: white;
}
.add-address{
	height: 75rpx;
	line-height: 72rpx;
	text-align: center;
	border: 1rpx solid $primary;
	border-radius: 50rpx;
}
.top-success{
	height: 50vh;
}
</style>
